
<div class="form">

<?php $form=$this->beginWidget('CActiveForm', array(
	'id'=>'user-form',
	'enableAjaxValidation'=>false,
	 'enableClientValidation'=>true,

)); ?>


		<div class="row">
		<?php echo $form->label($model,'job_type'); ?>
		<?php //echo $form->dropDownList($model,'job_type',ApplicationConfig::app()->params['job_params']['type'],array()); ?>
		<?php echo $form->dropDownList($model,'job_type',ApplicationConfig::app()->params['job_params']['type'],array('empty' => 'Select Job type')); ?>
		<?php echo $form->error($model,'job_type'); ?>
	</div>

	<input type="hidden" id="job_location_stateID_hidden" name="job_location_stateID_hidden" value=""class="job">
	<input type="hidden" id="job_location_cityID_hidden" name="job_location_cityID_hidden" value="">
	<div class="row">
	
		<?php echo $form->label($model,'job_location_stateID'); ?>
		<?php
							$this->widget('zii.widgets.jui.CJuiAutoComplete', array(
		     			 		'name'=>'Job[job_location_stateID]',
		      			 		'id'=>'job_location_stateID',
								'value'=>'',
		      					'source'=>'js: function(request, response) {
		   						 $.ajax({
		        					url: "'.$this->createUrl('/JobSearch/Getstate').'",
		        					dataType: "json",
		        					data: {
		            				term: request.term,           				
		        					},
		        					success: function (data) {
		                			response(data);
		        						}
		    						})
		 						}',
								//$this->createUrl('search/searchloc'),
		     			 		'options'=>array(
		                  		'showAnim'=>'fold',
								'minLength'=>'2',
		                  		'select'=> 'js:function(event, ui) {
		                  		$("#job_location_stateID").val(ui.item.value);
		                  		$("#job_location_stateID_hidden").val(ui.item.id);
		                  		$("#job_location_cityID").val("");
		                  		$("#job_location_cityID_hidden").val("");
		                  		
		                  		}'
								),
		                  		'htmlOptions'=>array('size'=>'40','class'=>'restaurant'),      
							 ));
						
							Yii::app()->clientScript->registerScript('custom_loc_search','	
			    			$("#job_location_stateID").data( "autocomplete" )._renderItem = function( ul, item ) {
			    					return $( "<li></li>" ) .data( "item.autocomplete", item ) .append( "<a><h6>" + item.value + "</h6></a>" ) .appendTo(ul);
			 					
							};');
						?>
		
		
	</div>
	
	<div class="row">
		<?php echo $form->label($model,'job_location_cityID'); ?>
		
		<?php
							$this->widget('zii.widgets.jui.CJuiAutoComplete', array(
		     			 		'name'=>'Job[job_location_cityID]',
		      			 		'id'=>'job_location_cityID',
								'value'=>'',
		      					'source'=>'js: function(request, response) {
		   						 $.ajax({
		        					url: "'.$this->createUrl('/JobSearch/GetLocation').'",
		        					dataType: "json",
		        					data: {
		            				term: request.term,
		            				state: $("#job_location_stateID_hidden").val(),           				
		        					},
		        					success: function (data) {
		                			response(data);
		        						}
		    						})
		 						}',
								//$this->createUrl('search/searchloc'),
		     			 		'options'=>array(
		                  		'showAnim'=>'fold',
								'minLength'=>'2',
		                  		'select'=> 'js:function(event, ui) {
		                  		$("#job_location_cityID").val(ui.item.value);
		                  		$("#job_location_cityID_hidden").val(ui.item.id);
		                  		
		                  		}'
								),
		                  		'htmlOptions'=>array('size'=>'40','class'=>'restaurant'),      
							 ));
						
							Yii::app()->clientScript->registerScript('custom_loc_search1','	
			    			$("#job_location_cityID").data( "autocomplete" )._renderItem = function( ul, item ) {
			    					return $( "<li></li>" ) .data( "item.autocomplete", item ) .append( "<a><h6>" + item.value + "</h6></a>" ) .appendTo(ul);
			 					
							};');
						?>
		
		
	</div>
	            	<div class="row">
		              <?php echo $form->labelEx($model,'Keywords'); ?>
		              <?php echo $form->textField($model,'keywords',array('size'=>60,'maxlength'=>100)); ?>
		              <?php echo $form->error($model,'keywords'); ?>
	           </div>
<a  href="javascript: void(0)" id="but">Advance Search </a>
<div id="adv" style="display:none">
            	<div class="row">
		              <?php echo $form->labelEx($model,'Work Experience'); ?>
		              <?php echo $form->textField($model,'work_experience_month',array('size'=>60,'maxlength'=>100)); ?>
		              <?php echo $form->error($model,'work_experience_month'); ?>
	           </div>
			   <div class="row">
		              <?php echo $form->labelEx($model,'salary'); ?>
		              <?php echo $form->textField($model,'salary',array('size'=>60,'maxlength'=>100)); ?>
		              <?php echo $form->error($model,'salary'); ?>
	           </div>
			   <div class="row">
		              <?php echo $form->labelEx($model,'qualification'); ?>
		              <?php echo $form->textField($model,'qualification',array('size'=>60,'maxlength'=>100)); ?>
		              <?php echo $form->error($model,'qualification'); ?>
	           </div>   
		<div class="row">
		<?php echo $form->label($model,'casual'); ?>
		
		<?php echo $form->dropDownList($model,'casual',ApplicationConfig::app()->params['job_params']['casual_type'],array('empty' => 'Select Job type')); ?>
		<?php echo $form->error($model,'job_type'); ?>
	</div>
   <div class="row">
		<?php echo $form->label($model,'Date of Job posted'); ?>
		<?php echo $form->dropDownList($model,'created',ApplicationConfig::app()->params['job_params']['posted_type'],array('empty' => ' select date')); ?>
		<?php echo $form->error($model,'job_type'); ?>
	</div>
			  
</div>

	<div class="row buttons">
		<?php echo CHtml::submitButton('Search', array('submit'=>ApplicationConfig::getURL("", "jobSearch", "searchJob")));?>
		<?php //echo CHtml::link('Search',ApplicationConfig::getURL("", "jobSearch", "searchJob"),array()); ?>
		
	</div>

<script>
$("#but").click(function () {
$("#adv").toggle();
$("#but").hide();

});    
</script>
<?php $this->endWidget(); ?>

</div><!-- form -->